<template>
  <van-cell class="article-item">
    <div
      class="title van-multi-ellipsis--l2"
      slot="title"
    >{{ article.title }}</div>
    <div slot="label">
      <div
        class="cover-wrap"
        v-if="article.cover.type === 3"
      >
        <div
          :key="index"
          class="cover-item"
          v-for="(img, index) in article.cover.images"
        >
          <van-image
            :src="img"
            class="cover-item-img"
            fit="cover"
            height="90"
            width="90"
          />
        </div>
      </div>
      <div class="label-info-wrap">
        <span>{{ article.aut_name }}</span>
        <span>{{ article.comm_count }}评论</span>
        <span>{{ article.pubdate | relativeTime }}</span>
      </div>
    </div>
    <van-image
      :src="article.cover.images[0]"
      class="right-cover"
      fit="cover"
      height="90"
      slot="default"
      v-if="article.cover.type === 1"
      width="90"
    />
  </van-cell>
</template>

<script>
export default {
  name: "ArticleItem",
  components: {},
  props: {
    article: {
      type: Object,
      required: true
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {}
};
</script>

<style scoped lang="stylus">
.van-cell__title
  display flex
  flex-direction column
  justify-content space-between
/deep/ .van-cell__value
  max-width 120px
.article-item
  .title
    font-size 15px
    color #3a3a3a


  .label-info-wrap span
    font-size 12px
    color #b4b4b4
    margin-right 10px

  .cover-wrap
    display flex
    padding 10px 0

    .cover-item
      flex 1
      height 100px
      display flex
      justify-content center
      align-items center
</style>